//
//  NSArray+ACCommon.h
//  AcmedcareCore
//
//  Created by AcZx on 2018/3/9.
//

#import <Foundation/Foundation.h>

@interface NSArray (ACCommon)
/**
 * 大数组拆分成小数组(逐个放入)
 */
- (NSArray *_Nullable)changeArrayWithIndex:(int)index;

/**
 * plist文件转数组
 */
+ (nullable NSArray *)arrayWithPlistData:(NSData *_Nullable)plist;
+ (nullable NSArray *)arrayWithPlistString:(NSString *_Nullable)plist;

/**
 * 数组打乱
 */
- (id _Nullable )randomObject;

/**
 * 数组转Json字符串
 */
- (NSString *_Nullable)jsonPrettyStringEncoded;

@end




@interface NSMutableArray<ObjectType>  (ACCommon)
/**
 * plist 文件转数组
 */
+ (nullable NSMutableArray *)arrayWithPlistData:(NSData *_Nullable)plist;
+ (nullable NSMutableArray *)arrayWithPlistString:(NSString *_Nullable)plist;

- (void)insertObjects:(NSArray *_Nullable)objects atIndex:(NSUInteger)index;
/**
 * 数组颠倒
 */
- (void)reverse;
/**
 * 数组打乱
 */
- (void)shuffle;

@end
